package com.neudu.glsb.service.impl;

import com.neudu.glsb.pojo.OperationRecords;
import com.neudu.glsb.service.OperationRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class SomeServiceImpl {

    @Autowired
    private OperationRecordsService operationRecordService;

    public void updateData() {
        // ... existing code ...
        // 执行数据更新操作

        // 记录操作信息
        OperationRecords record = new OperationRecords();
        record.setOperationTime(new Date());
        record.setOperationType("数据更新");
        record.setAdminId(record.getAdminId()); // 这里可以从安全上下文中获取当前用户
        record.setOperationDetail("执行了数据更新操作");

        operationRecordService.save(record);
    }
}